package com.czn.shopdemo.utils;

import javax.servlet.http.HttpServletRequest;

/**
 * @author Zenan Chen
 * @date 2023/4/4 10:02
 */
public class TokenInfoUtil {

    public static Long getUserId(HttpServletRequest request) {
        String token = request.getHeader("token");
        Long userId = JwtUtil.getUserId(token);
        return userId;
    }

    public static String getUserName(HttpServletRequest request) {
        String token = request.getHeader("token");
        String userName = JwtUtil.getUserName(token);
        return userName;
    }
}
